<%@ page language="java" import="java.util.*,com.suggestion.bean.*"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="m" uri="mytaguri" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@page import="java.text.SimpleDateFormat"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'SuggestionList.jsp' starting page</title>


	</head>

	<body bgcolor="#FAFBE7">
		<center>
			<% if(session.getAttribute("userId") == null){
			%>
			未登录，请先登录
			<%
			
			}else{
			
			%>
			用户编号<%=session.getAttribute("userId")%>
			<a href="<%=basePath%>suggestion/addSuggestion.jsp">评论</a>
			<% } %>
			
			<table border="1" bordercolor="#FFFFEF" width="600">
				<tr>
					<td style="border: 1px solid #009999">
						序号
					</td>
					<td style="border: 1px solid #009999">
						用户ID
					</td>
					<td style="border: 1px solid #009999">
						用户名称
					</td>
					<td style="border: 1px solid #009999">
						评论内容
					</td>
					<td style="border: 1px solid #009999">
						评论时间
					</td>
					
				</tr>
				
				<% List<List> sugg=(List<List>)request.getAttribute("suggestionListLimit");
						for(int i=0;i<sugg.size();i++){
						List suggestion=sugg.get(i);
						SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd mm:hh:ss");
						String time=format.format(suggestion.get(4));
					
						%>
				<tr>
					<td style="border: 1px solid #009999"><%=i+1 %></td>
					<td style="border: 1px solid #009999"><%=suggestion.get(1) %></td>
					<td style="border: 1px solid #009999"><%=suggestion.get(2) %></td>
					<td style="border: 1px solid #009999"><%=suggestion.get(3) %></td>
					<td style="border: 1px solid #009999"><%=time %></td>
				
				</tr>
				<%
						}
				%>
			
			</table>
		</center>
	</body>
</html>
